import { createRouter, createWebHistory } from 'vue-router'
import Login from '../components/Login.vue'
import AdminLayout from '../components/AdminLayout.vue'
import Home from '../views/Home.vue'

const routes = [
  // { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  { path: '/', redirect: '/admin' },
  {
    path: '/admin',
    component: AdminLayout,
    children: [
      {
        path: '',
        component: Home
      }
    ]
    // redirect: '/admin',
    // children: [
    //   {
    //     path: '/admin/user'
    //   }
    // ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 